﻿using System.Collections.Generic;
using System.Linq;
using ZY.EntityFrameWork.WcfSvcLib.Interface;
using ZY.EntityFrameWork.Caller.Facade;
using ZY.EntityFrameWork.Core.Model.Dto;

namespace ZY.EntityFrameWork.Caller.WcfCaller
{
    public class WcfArvOpService : ServiceProxyBase<IWcfArvOpService>, IArvOpService
    {
        public WcfArvOpService() : base("WcfArvOpService") { }

        #region 位置信息
        public int AddNewLocation(ArvLocationDto dto)
        {
            return this.Invoker.Invoke<int>(q => q.AddNewLocation(dto));
        }

        public int AddNewLocations(List<ArvLocationDto> dtos)
        {
            return this.Invoker.Invoke<int>(q => q.AddNewLocations(dtos));
        }

        #endregion

        #region 入库相关

        /// <summary>
        /// 查找在库档案
        /// </summary>
        /// <returns></returns>
        public List<ArchiveInfoDto> GetArvInLib()
        {
            return this.Invoker.Invoke<List<ArchiveInfoDto>>(q => q.GetArvInLib());
        }

        /// <summary>
        /// 档案入库
        /// </summary>
        /// <param name="arv"></param>
        public int InputToLib(ArchiveInfoDto arv)
        {
            return this.Invoker.Invoke<int>(q => q.InputToLib(arv));
        }

        /// <summary>
        /// 多条档案同时入库
        /// </summary>
        /// <param name="arvs"></param>
        /// <returns></returns>
        public int InputToLib(List<ArchiveInfoDto> arvs)
        {
            return this.Invoker.Invoke<int>(q => q.InputToLib(arvs));
        }

        /// <summary>
        /// 单个档案放入柜中(后期看情况第二个参数改成档案盒编号)
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="locDto"></param>
        /// <returns></returns>
        public int InputToCab(ArchiveInfoDto dto, ArvLocationDto locDto)
        {
            return this.Invoker.Invoke<int>(q => q.InputToCab(dto,locDto));
        }

        /// <summary>
        /// 多个档案放入同一位置
        /// </summary>
        /// <param name="arvs"></param>
        public int InputToCab(List<ArchiveInfoDto> arvs, ArvLocationDto locDto)
        {
            return this.Invoker.Invoke<int>(q => q.InputToCab(arvs, locDto));
        }
        #endregion

        #region 借阅相关
        /// <summary>
        /// 查找在柜档案
        /// </summary>
        /// <returns></returns>
        public List<ArchiveInfoDto> GetArvInCab()
        {
            return this.Invoker.Invoke<List<ArchiveInfoDto>>(q => q.GetArvInCab());
        }

        public int ArvLend(LendInfoDto lendInfo, List<ArchiveInfoDto> arvInfos)
        {
            return this.Invoker.Invoke<int>(q => q.ArvLend(lendInfo,arvInfos));
        }

        #endregion

        #region 归还相关
        /// <summary>
        /// 查找被借阅的档案
        /// </summary>
        /// <returns></returns>
        public List<ArchiveInfoDto> GetArvLended()
        {
            return this.Invoker.Invoke<List<ArchiveInfoDto>>(q => q.GetArvLended());
        }

        public int ArvReturn(ReturnInfoDto returnInfo, List<ArchiveInfoDto> arvInfos)
        {
            return this.Invoker.Invoke<int>(q => q.ArvReturn(returnInfo, arvInfos));
        }
        #endregion

        #region 出柜相关

        public int ArvOutput(OutCabInfoDto dto, List<ArchiveInfoDto> arvInfos)
        {
            return this.Invoker.Invoke<int>(q => q.ArvOutput(dto, arvInfos));
        }

        #endregion
    }
}
